package com.tools.pojo.user.bo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Getter;
import lombok.Setter;


@Getter
@Setter
public class MenuBO {

    @Schema(description = "菜单ID")
    private Long id;

    @Schema(description = "菜单名称")
    @NotBlank(message = "菜单名称不能为空")
    @Size(max = 50, message = "菜单名称最长50个字符")
    private String name;

    @Schema(description = "菜单类型（0目录 1菜单 2按钮）")
    @NotNull(message = "菜单类型不能为空")
    @Min(value = 0, message = "类型范围0-2")
    @Max(value = 2, message = "类型范围0-2")
    private Integer type;

    @Schema(description = "菜单图标")
    private String icon;

    @Schema(description = "路由路径")
    private String path;

    @Schema(description = "组件路径")
    private String component;

    @Schema(description = "权限标识")
    @Pattern(regexp = "^[a-zA-Z0-9:]*$", message = "权限标识只能包含字母、数字和冒号")
    private String permission;

    @Schema(description = "父菜单ID")
    private Long parentId;

    @Schema(description = "显示排序")
    private Integer sort;

    @Schema(description = "重定向路径")
    private String redirect;

    @Schema(description = "菜单状态（0正常 1停用）")
    private Integer status;

     @Schema(description = "是否外链（true/false）")
    private Boolean isExternal;

    @Schema(description = "是否缓存（true/false）")
    private Boolean keepAlive;

    @Schema(description = "菜单层级")
    private Integer level;

}
